﻿//
// MainPage.xaml.h
// Declaration of the MainPage class.
//

#pragma once

#include "MainPage.g.h"
#include "cnf_sat_solver.h"

namespace OverSatX
{
	/// <summary>
	/// An empty page that can be used on its own or navigated to within a Frame.
	/// </summary>
	public ref class MainPage sealed
	{
		Platform::String^ textFileContent;
		sat::cnf_sat_solver sat_solver_factory;
		solver::problem_solver *sat_solver;
		bool IsRunning = false;
		bool IsStopped = true;

	public:
		MainPage();

	private:
		void btnCnfLoad_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
		void btnSATStep_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
		void btnSATCalc_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
		void btnSATStop_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
		void DrawProblem();
		void DrawEverything(bool finished);
		bool SingleStep();
		void RunBackground();
		void SetStatus(const wchar_t *statusText);
	};
}
